import { _decorator, Component,Vec3,Vec2,tween, Node, sp } from 'cc';
import { UICtrl } from '../../../Framework/Managers/UICtrl';
import { RoleCtrl } from '../../../Framework/Managers/RoleCtrl';
const { ccclass, property } = _decorator;

@ccclass('Boss_Ctrl')
export class Boss_Ctrl extends RoleCtrl {

    onLoad(): void {
        super.onLoad();
    }
    
    init(pathData){
        this.type = "boss";
        this.skinName = "cike";
        this.playerImg = this.getChildOrComponent("bossImg",sp.Skeleton);
        this.moveDir = "forward"
        this.movePosArr = pathData;
        this.moveCharacter(0);
    }

    bossExit(pos){
        this.moveDir = "retreat"
        this.movePosArr.reverse();
        this.movePosArr.push(pos);
        this.moveCharacter(0);
    }

    die(){
        if (this.node) {
            this.node.destroy();
        }
    }
    
}


